---
name: mirror-deps
on:
  workflow_dispatch:
permissions:
  contents: read
jobs:
  sync_deps:
    permissions:
      contents: read
      packages: write
    runs-on: ubuntu-latest-16-cores
    steps:
    - uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc  # v2
      with:
        username: ${{ secrets.DOCKERHUB_USER }}
        password: ${{ secrets.DOCKERHUB_PASSWORD }}
    - uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc  # v2
      with:
        registry: ghcr.io
        username: ${{ github.actor }}
        password: ${{ secrets.GITHUB_TOKEN }}
    - uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc  # v2
      with:
        registry: quay.io
        username: ${{ secrets.QUAY_IO_USER }}
        password: ${{ secrets.QUAY_IO_PASSWORD }}
    - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3  # v3.5.0
    - uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9  # v4.0.0
      with:
        go-version-file: 'go.mod'
    - name: install regbot
      shell: bash
      run: go install github.com/regclient/regclient/cmd/regbot@v0.4.8
    - name: sync images
      shell: bash
      # yamllint disable rule:indentation
      run: |
        cd scripts/regclient
        regbot once --config regbot_deps.yaml
      # yamllint enable rule:indentation
